﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsGameLibrary1
{
    public class Animation
    {
        private int spriteCount;
        private float animationTime;


        public Animation()
        {
            spriteCount = 0;
            animationTime = 0;
            frames = new List<Frame>();
        }



        public int SpriteCount
        {
            get { return spriteCount; }
            set { spriteCount = value; }
        }

        public float AnimationTime
        {
            get { return animationTime; }
            set { animationTime = value; }
        }
        List<Frame> frames;

        public void CalcAnimationTime()
        {
            animationTime = 0;
            for (int i = 0; i < frames.Count; i++)
            {
                animationTime += frames[i].Duration;
            }
        }

        public void AddFrame(Frame frame)
        {
            frames.Add(frame);
        }

        public Frame getFrame(int i)
        {
            return frames[i];
        }

        public void RemFrame(Frame frame)
        {
            frames.Remove(frame);
        }

        public void RemFrame(int frame)
        {
            frames.RemoveAt(frame);
        }
    }
}
